package com.cdl;

/**
 * @author cdl
 * @date 2025/10/1
 */
public class InitBlockA {
    private String name;
    private static String nickName;
    // 普通初始化块2
    {
        System.out.println("This is common init block 2");
        this.name = "name02";
        nickName = "nickName02";
    }

    // 普通初始化块1
    {
        System.out.println("This is common init block 1");
        this.name = "name01";
        nickName = "nickName01";
    }

    // 构造方法
    public InitBlockA() {
        System.out.println("This is Constructor without params");
    }

    public String getName(){
        return name;
    }
}
